﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Birthday
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        //退出系统
        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("确定要关闭程序吗？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                Application.Exit();
            }
        }
        //弹出提醒效果
        private void button2_Click(object sender, EventArgs e)
        {

        }
        //新增好友信息
        private void button3_Click(object sender, EventArgs e)
        {

            //点击跳转到新增好友信息
            new Thread(() => {
                Application.Run(new Form2());
            }).Start();
            this.Close();
        }
        //浏览查询
        private void button4_Click(object sender, EventArgs e)
        {
            //点击跳转到浏览好友信息
            new Thread(() => {
                Application.Run(new Form3());
            }).Start();
            this.Close();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //让最小化窗口不在任务栏
            this.ShowInTaskbar = false;
        }

        private void 恢复页面ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            WindowState = FormWindowState.Normal;
        }

        private void 退出系统ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("确定要关闭程序吗？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                Application.Exit();
            }
        }
    }
}
